package com.hydra.cron.server.zookeeper;

import com.hydra.cron.common.constants.C;
import com.hydra.cron.common.curator.helper.CuratorHelper;
import com.hydra.cron.server.builder.CronServerBuilder;
import com.hydra.cron.server.model.CronServer;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.UUID;

/**
 * hdyraCron Created by ZhengGong on 15/12/10.
 * PackageName com.hydra.cron.server.zookeeper
 * Description
 */
//@Component
public class ZookeeperManager {
    private static final String TOKEN = UUID.randomUUID().toString().replace("-", "");
    private static final String JOB_NAME = "cronServer";

    public void init() throws Exception {
        CronServer cronServer=CronServerBuilder.build(TOKEN,JOB_NAME,false);
        List<String> paths = CuratorHelper.getChildrenNodePath(C.PATH.SERVER_MASTER);
        System.out.println(123);
//        System.out.println(paths.get(0));
//        System.out.println(paths.size());
    }
}
